home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_form.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-04-09  |  5.0 KB  |  101 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="430" height="310" caption="Form">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.             <label name="lblDataFormat" caption="Dataformat" hint="" width="52" height="13" top="56" left="240"/>
  6.             <label name="lblMethod" caption="Method" hint="" width="30" height="13" top="8" left="240"/>
  7.             <label name="lblAction" caption="Action" hint="The action that the form should execute. You can use this to refer to an external script, for instance." width="42" height="13" top="56" left="8"/>
  8.             <label name="lblName" caption="Name" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance." width="26" height="13" top="8" left="8"/>
  9.             <edit name="edtName" taborder="0" text="" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance." width="225" height="19" top="24" left="8"/>
  10.             <edit name="edtAction" taborder="2" text="" hint="The action that the form should execute. You can use this to refer to an external script, for instance." width="225" height="19" top="72" left="8"/>
  11.             <combobox name="comDataFormat" taborder="3" text="application/x-www-form-urlencoded" hint="Select the data format used to submit this form." width="145" height="21" top="72" left="240">
  12.                 <items>
  13.                     application/x-www-form-urlencoded
  14.                     multipart/form-data
  15.                     text/plain        
  16.                 </items>
  17.             </combobox>
  18.             <combobox name="comMethod" taborder="1" text="get" hint="The method used to send the form data." width="145" height="21" top="24" left="240">
  19.                 <items>
  20.                     get
  21.                     post    
  22.                 </items>
  23.             </combobox>
  24.         </panel>
  25.     </controls>
  26.     <dialogevents>
  27.         <event type="onclose" resulttype="ok">
  28.             StartCode := '<form';
  29.             If edtName.Text <> '' then
  30.              StartCode := Startcode + ' name="'+edtName.Text+'"';
  31.             If comMethod.Text <> '' then
  32.              StartCode := Startcode + ' method="'+(comMethod.Text)+'"';
  33.             If edtAction.Text <> ''  then
  34.              StartCode := Startcode + ' action="'+(edtAction.Text)+'"';
  35.             if (comDataFormat.Text <> '') and (comDataFormat.Text <> 'application/x-www-form-urlencoded') then
  36.              StartCode := Startcode + (' enctype="'+(comDataFormat.Text)+'"');
  37.  
  38.               If edtCSSClass.Text <> '' then
  39.              StartCode := StartCode + ' class="'+edtCSSClass.Text+'"';
  40.               If edtCSSId.Text <> '' then
  41.                StartCode := StartCode + ' ID="'+edtCSSId.Text+'"';
  42.               If edtCSSStyle.Text <> '' then
  43.                StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"';
  44.             for i := 0 to EventGrid.Count - 1 do
  45.               begin
  46.               if EventGrid.Rows[i].EditText <> '' then
  47.                StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  48.              end;  
  49.              
  50.             StartCode := StartCode + '>';
  51.             EndCode := '</form>';             
  52.              
  53.             If cbMakeXHTMLCompliant.Checked then
  54.              StartCode := MakeXHTMLCompliant(StartCode, true);
  55.             If cbDoPHPEscape.Checked then
  56.              StartCode := DoPHPEscape(StartCode);         
  57.             // A little "hack" - WebCoder will set this, to let us know whether to update
  58.             // an existing tag, or insert a brand new one
  59.             If cbUpdateExistingTag.Checked then 
  60.              ReplaceTag(StartCode)
  61.             else 
  62.                InsertTags(StartCode, EndCode);   
  63.               
  64.         </event>
  65.         <event type="onshow">    
  66.             // Lets put the advanced panel in the right place
  67.             pnlAdvanced.Parent := MainPanel;
  68.             pnlAdvanced.Left := 8;
  69.             pnlAdvanced.Top := MainPanel.Height - 32;        
  70.             pnlAdvanced.Width := Self.Width - 36;
  71.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  72.             If pnlAdvanced.Height > 20 then
  73.              Self.Height := Self.Height + 200;
  74.         </event>
  75.         <event type="updatedialog">
  76.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  77.             // The entire selected tag will be passed as a parameter to this function, that should update
  78.             // the required fields of the dialog.
  79.             function UpdateDialog(Tag: string);
  80.              begin
  81.               edtName.Text := GetValueFromAttribute(Tag, 'name');
  82.               comMethod.Text := GetValueFromAttribute(Tag, 'method');
  83.               edtAction.Text := GetValueFromAttribute(Tag, 'action');
  84.               comDataFormat.Text :=  GetValueFromAttribute(Tag, 'enctype');
  85.                          
  86.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  87.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  88.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  89.               for i := 0 to EventGrid.Count - 1 do
  90.                 begin
  91.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  92.                  If EventVal <> '' then
  93.                   EventGrid.Rows[i].EditText := EventVal;
  94.                end;  
  95.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  96.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();                            
  97.              end;
  98.         </event>
  99.     </dialogevents>
  100. </dialog>
  101.